<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>各种数据导入到织梦-V2 PHP系统导入到织梦</title>
    <!--
    各种数据导入织梦版本V2 实现PHP系统导入到织梦，可选复制图片备份
    -->
    <link href="public/css/jquery-ui.css" rel="stylesheet">
    <!--z-tree插件-->
    <link href="public/css/zTreeStyle.css" rel="stylesheet">
    <!--顶部提示插件-->
    <link href="public/css/overhang.min.css" rel="stylesheet">
    <link href="public/css/custom.css" rel="stylesheet">
    <!--拖拽插件-->

    <script data-main="public/js/main-v2" src="public/js/require.js"></script>
    <!-- todo 谨记：main.js 加载了两次当然里边代码执行两次  <script src="public/js/main.js"></script>-->
</head>
<body>

<div class="custom-state-box">
    <h2 class="demoHeaders">状态显示：<b style="color: red;">（版本二：MySQL数据导入到织梦）</b><a href="javascript:;" id="backMenu">返回菜单</a></h2>
    <div class="custom-state-container">
        <ol>
            <li>
                <!--1、数据库连接配置 2、导入字段配置 3、导入栏目ID配置<i class="ui-state-highlight">&nbsp;&nbsp;&nbsp;&nbsp;</i>-->
                <fieldset>
                    <legend>配置状态</legend>
                    <div id="statusgroup">
                        <span>
                            导出库状态：<i id="from-db-state" class="ui-state-error ui-corner-all custom-state-text">未测试</i>
                            导入库状态：<i id="to-db-state" class="ui-state-error ui-corner-all custom-state-text">未测试</i>
                            导出栏目：<i id="from-type-state" class="ui-state-error ui-corner-all custom-state-text">[0]未选择栏目</i>
                            导入栏目：<i id="to-type-state" class="ui-state-error ui-corner-all custom-state-text">[0]未选择栏目</i>
                        </span>
                    </div>

                </fieldset>
                <!--<div class="custom-shade"></div>-->
            </li>
            <li>
                <fieldset>
                    <legend>导入进度</legend>
                    <div id="progressbar"></div>
                </fieldset>
            </li>
            <li>
                <fieldset>
                    <legend>控制面板</legend>
                    <!--<button id="loadconfig-button" class="ui-button ui-corner-all ui-widget">加载当前配置</button>-->
                    <div id="controlgroup">
                        <label for="is-export-images">是否导出图片</label>
                        <input type="checkbox" name="is-export-images" id="is-export-images">
                    </div>
                    <span style="color: red;">刷新页面会取消导出图片！</span>
                    <button id="start-button" class="ui-button ui-corner-all ui-widget">开始导入</button>
                </fieldset>
            </li>
        </ol>
    </div>
</div>

<!-- 手风琴 -->
<h2 class="demoHeaders">操作步骤：<span style="color: red;">注意每次使用先重置再保存！</span></h2>


<div id="accordion">
    <h3>步骤一：填写数据库配置</h3>
    <div class="container one" style="height: 200px">
        <div class="custom-form-box custom-left">
            <h4>导出数据库配置</h4>
            <form class="cfg_form" id="from_cfg_form" name="from_cfg_form">
                <ol>
                    <li><label>数据库链接：</label><input type="text" name="dbhost" value="127.0.0.1" placeholder="localhost"> </li>
                    <li><label>用户名：</label><input type="text" name="dbuser" value="root" placeholder="user"> </li>
                    <li><label>密码：</label><input type="text" name="dbpwd" value="root" placeholder="password"> </li>
                    <li><label>数据库名称：</label><input type="text" name="dbname" value="" placeholder="databasename"> </li>
                    <li><label>数据表前缀：</label><input type="text" name="dbprefix" value="" placeholder="pre_"> </li>
                    <li><label>数据库编码：</label><input type="text" name="dblanguage" value="utf-8" placeholder="utf-8"> <span style="color: red;">注意编码！</span></li>
                    <li><label></label><button id="from-cfg-save-button" class="ui-button ui-corner-all ui-widget" type="button">保存配置</button></li>
                </ol>
            </form>
        </div>
        <div class="custom-form-box custom-right">
            <h4>导入数据库配置</h4>
            <form class="cfg_form" id="to_cfg_form" name="to_cfg_form">
                <ol>
                    <li><label>数据库链接：</label><input type="text" name="dbhost" value="127.0.0.1" placeholder="localhost"> </li>
                    <li><label>用户名：</label><input type="text" name="dbuser" value="root" placeholder="user"> </li>
                    <li><label>密码：</label><input type="text" name="dbpwd" value="root" placeholder="password"> </li>
                    <li><label>数据库名称：</label><input type="text" name="dbname" value="" placeholder="databasename"> </li>
                    <li><label>数据表前缀：</label><input type="text" name="dbprefix" value="dede_" placeholder="dede_"> </li>
                    <li><label>数据库编码：</label><input type="text" name="dblanguage" value="utf-8" placeholder="utf-8"> <span style="color: red;">注意编码！</span></li>
                    <li><label></label><button id="to-cfg-save-button" class="ui-button ui-corner-all ui-widget" type="button">保存配置</button></li>
                </ol>
            </form>
        </div>
    </div>
    <h3>步骤二：选择导入栏目ID</h3>
    <div class="container two">
        <h4>
            <button id="import-type-save-button" class="ui-button ui-corner-all ui-widget">保存导入栏目配置</button>
            <button id="import-cfg-reset-to-button" class="ui-button ui-corner-all ui-widget">重置导入栏目</button>
        </h4>
        <div>
            <h4>导入数据库栏目列表</h4>
            <ul id="toTree" class="ztree custom-ztree"></ul>
        </div>
    </div>
    <h3>步骤三：选择导出数据库栏目表</h3>
    <div class="container three">
        <input name="list1SortOrder" type="hidden" />
        <h4>
            <button id="form-cate-cfg-save-button" class="ui-button ui-corner-all ui-widget">保存配置</button>
            <button id="form-cate-cfg-reset-button" class="ui-button ui-corner-all ui-widget">重置数据库表</button>
        </h4>
        <div class="custom-form-box custom-left">
            <h4>导出数据库数据表-列表</h4>
            <ul class="to-field" id="from_tables_lists">
                <li><i>X</i><div data-id="1">暂无数据请重置加载</div></li>
            </ul>
        </div>
        <div class="custom-form-box custom-right">
            <h4>导出数据库栏目表</h4>
            <ol>
                <li>
                    <label>栏目表名称（category）：</label>
                    <ul class="to-field" id="form_table_cate">

                    </ul>
                </li>
            </ol>
        </div>
    </div>
    <h3>步骤四：选择导出栏目表关联字段</h3>
    <div class="container four">
        <h4>
            <button id="field-cate-save-button" class="ui-button ui-corner-all ui-widget">保存类别表映射</button>
            <button id="field-cate-reset-button" class="ui-button ui-corner-all ui-widget">重置类别表字段</button>
        </h4>
        <div class="custom-form-box custom-left">
            <h4>导出数据表字段列表</h4>
            <ul class="to-field" id="from_field_lists">
                <li><i>X</i><div data-id="1">暂无数据请重置加载</div></li>

            </ul>
        </div>
        <div class="custom-form-box custom-right">
            <h4>导入数据表字段列表（暂列出必须字段）无限级栏目默认字段设计</h4>
            <ol>
                <li>
                    <label>数据标识ID（id）：</label>
                    <ul class="to-field" id="to_field_id">

                    </ul>
                </li>
                <li>
                    <label>数据父类ID（parentId）：</label>
                    <ul class="to-field" id="to_field_pid">

                    </ul>
                </li>
                <li>
                    <label>栏目名称（typeName）：</label>
                    <ul class="to-field" id="to_field_name">

                    </ul>
                </li>
            </ol>
        </div>

    </div>
    <h3>步骤五：选择导出栏目ID</h3>
    <div class="container five">
        <div id="messageBox"></div>
        <h4>
            <button id="export-cfg-save-button" class="ui-button ui-corner-all ui-widget">保存导出栏目ID</button>
            <button id="export-cfg-reset-button" class="ui-button ui-corner-all ui-widget">重置导出栏目</button>
        </h4>
        <div class="custom-form-box custom-left">
            <h4>导出数据库栏目ID配置</h4>

            <ul id="fromTree" class="ztree"></ul>
        </div>

    </div>
    <h3>步骤六：加载数据表并选择导出栏目数据表</h3>
    <div class="container six">
        <h4>
            <button id="export-table-save-button" class="ui-button ui-corner-all ui-widget">保存导出数据表配置</button>
            <button id="export-table-reset-button" class="ui-button ui-corner-all ui-widget">重置导出数据库表</button>
        </h4>
        <div class="custom-form-box custom-left">
            <h4>导出数据表字段列表</h4>
            <ul class="to-field" id="export_table_lists">
                <li><i>X</i><div data-id="1">暂无数据点击重置数据</div></li>
            </ul>
        </div>
        <div class="custom-form-box custom-right">
            <h4>导入数据表字段列表（暂列出必须字段）</h4>
            <ol>
                <li>
                    <label>文章内容主表（master）：</label>
                    <ul class="to-field" id="from_table_master">

                    </ul>
                </li>
                <li>
                    <label>文章附加表（slave-additional）：</label>
                    <ul class="to-field" id="from_table_additional">

                    </ul>
                </li>

            </ol>
        </div>

    </div>
    <h3>步骤七：加载导入数据表拖拉配置与导入表字段关联</h3>
    <div class="container seven">
        <h4>
            <button id="field-map-save-button" class="ui-button ui-corner-all ui-widget">保存数据表关联配置</button>
            <button id="field-export-reset-button" class="ui-button ui-corner-all ui-widget">重置导出数据表配置</button>
            <button id="field-import-reset-button" class="ui-button ui-corner-all ui-widget">重置导入数据表配置</button>
        </h4>

        <div class="custom-form-box custom-left">
            <h4>导出数据表字段列表（<span style="color: red;">可以重复加载，以保证右侧数据基本完整</span>）</h4>
            <ul class="to-field" id="export_fields_lists">
                <li><i>X</i><div data-id="1">暂无数据</div></li>
            </ul>
        </div>

        <div class="custom-form-box custom-right">
            <h4>导入数据表字段列表（暂列出必须字段）<span style="color: red;">没有附加表，2和3可以不配置</span></h4>
            <ol id="import_fields_lists">
                <li><label>暂无数据请点击重置按钮</label><ul class="to-field"></ul></li>
            </ol>
        </div>
    </div>
    <h3>步骤八：关键字段配置导入属性（字段转换暂时只支持1、文件编码；2、选择一项）</h3>
    <div class="container eight">
        <h4>
            <button id="relevance-save" class="ui-button ui-corner-all ui-widget">保存操作配置</button>
            <button id="relevance-reload" class="ui-button ui-corner-all ui-widget">重新加载关联列表</button>
            <button id="relevance-reset" class="ui-button ui-corner-all ui-widget">重置关联配置</button>
            <span style="color: red;">重置后需要“步骤七”重新保存。并重新“加载关联列表”并“保存操作配置”</span>
        </h4>

        <ol id="relevance_field_lists">
            <li><strong>暂无数据请重新加载关联列表</strong></li>
         </ol>
    </div>
</div>


</body>
</html>